
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="../lib/jquery.js"></script>
    <link rel="stylesheet" href="../../../component/jquery/notice/alert/com-alert.css">
    <script src="../../../component/jquery/notice/alert/com-alert.js"></script>
    <style>
        .aa{
            position: fixed;
            left:0;
            top:0;
            width: 100%;
            height:100%;
            background: rgba(0,0,0,.5);
        }
    </style>
</head>
<body>
<div id="listHeight" style="100px;">
    child
    child<br/>
    child
    <iframe id="childAgent"  height="0" width="0"  src="/data/demo/javascript/iframe/agent.html" style="display:none" ></iframe>
</div>

<script>
    $(function(){
        var height = $("body").height();
        var childAgentSrc = document.getElementById("childAgent");
        childAgentSrc.src = childAgentSrc.src + "#" + height;  // 这里通过hash传递b.htm的宽高


        var str = "<div class='aa'><span id='ddd'>ddddddddddddd</span></div>";
        var obj = $(str);
            obj.find('#ddd').on('click',function(){
                $(this).remove();
            })

        $("#listHeight").on('click',function(){
            var parent = window.parent;
            $(window.parent.document).find('body').append(obj);
            console.log(parent)
            //$('body').append("<div class='aa'>shabi hahahhaahah</div>")
        })

        $("#listHeight").on('click',function(){
            $.alert({
                message:'hahahaha'
            })
        })
    });
</script>
</body>
</html>